package main

import "fmt"

/*
* Author: JacksonCoder
* CreateTime: 2025/5/20
 */
type SkillsService1 interface {
	Running2()
	GetName2() string
}

type Test interface {
	Sleeping()
	SkillsService1 // 继承 SkillsService1
}

type Student2 struct {
	Name string
	Age  int
}

type Teacher2 struct {
	skill  SkillsService1 // skill 也只能当变量去用
	Name   string
	Salary int
}

func (p Student2) GetName2() string { //实现GetName2方法
	fmt.Println(p.Name)
	return p.Name
}

func (p Student2) Running2() { // 实现 Running方法
	fmt.Printf("%s running", p.Name)
}

func (p Teacher2) GetName2() string { //实现GetName2方法
	fmt.Println(p.Name)
	return p.Name
}

func (p Teacher2) Running2() { // 实现 Running方法
	fmt.Printf("\n%s running", p.Name)
}

func (p Teacher2) Sleeping() { // 实现 Running方法
	fmt.Printf("\n%s Sleeping", p.Name)
}

func main(){
	var skill SkillsService1
	var stu Student2
	var t1 Teacher2
	t1.Name = "Nexora"
	stu.Name = "alen"
	stu.Age = 18
	skill = stu
	skill.Running2()
	skill = t1
	t1.Running2()

	var test Test
	test = t1
	test.Sleeping()
}